package com.rj.bd.er;
/**
 * @desc   comparable接口
 * @author lipf
 * @time   2021-10-01
 */
public class Person implements Comparable<Person> {

	String name;
	int age;
	
	
	@Override
	public int compareTo(Person p) {
		return this.name.compareTo(p.getName());
	}


	protected String getName() {
		return name;
	}


	protected void setName(String name) {
		this.name = name;
	}


	protected int getAge() {
		return age;
	}


	protected void setAge(int age) {
		this.age = age;
	}


	public Person(String name, int age) {
		this.name = name;
		this.age = age;
	}

	

	
	
	
	
}
